package com.zookeeper.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/zk7001")
public class OrderController {
    private String URL="http://zk-service-7002";
    @Autowired
    private RestTemplate restTemplate;
    @GetMapping("get")
    public String get(){
        //调用7002服务 通过服务名称调用
      return   restTemplate.getForObject(URL+"/zk7002/get",String.class);
    }
}
